﻿<%@ Page Title="" Language="C#" MasterPageFile="~/default.Master" AutoEventWireup="true" CodeBehind="RoomGuest.aspx.cs" Inherits="DelonixRegia.WebForm2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphPageTitle" runat="server">
    Room Guests Report - Delonix Regia
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphTitle" runat="server">
    Room Guests Report  
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphSubtitle" runat="server">
    Get guest details of a particular room 
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphMain" runat="server">
    <asp:Panel ID="pnlFirstStep" runat="server">
        <div class="panel panel-default" id="firstStep" style="width: 800px; margin: 0 auto;">
        <div class="panel-heading">
            List all guests in a particular room</div>
        <div class="panel-body">
            <div id="errorBox" class="alert alert-danger" style="display:none;">
            </div>
            <table class="nav-justified" style="width:765px;">
                
               
                
                <tr>
                    <td style="width: 165px; height: 32px;" class="text-right">
                        <asp:ScriptManager ID="ScriptManager1" runat="server">
                        </asp:ScriptManager>
                    </td>
                    <td style="width: 50px; height: 32px;" class="text-right">Floor:</td>
                    <td style="width: 188px; height: 32px;">
                        <asp:UpdatePanel ID="FloorUpdatePanel" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="ddlFloor" runat="server" AutoPostBack="True" CssClass="form-control" OnSelectedIndexChanged="ddlFloor_SelectedIndexChanged" Width="188px">
                                    <asp:ListItem Selected="True">Not Selected</asp:ListItem>
                                    <asp:ListItem Value="1">1</asp:ListItem>
                                    <asp:ListItem Value="2">2</asp:ListItem>
                                    <asp:ListItem Value="3">3</asp:ListItem>
                                </asp:DropDownList>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                    <td style="width: 52px; height: 32px;" class="text-right">Room:</td>
                    <td style="width: 16px; height: 32px">
                        <asp:UpdatePanel ID="roomUpdatePanel" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="ddlRoom" runat="server" CssClass="form-control" Enabled="False" Width="188px">
                                    <asp:ListItem Selected="True">Not Selected</asp:ListItem>
                                </asp:DropDownList>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="ddlFloor" EventName="SelectedIndexChanged" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </td>
                    <td style="width: 165px; height: 32px;">
                    </td>
                    
                </tr>
                <tr>
                    <td style="width: 165px">&nbsp;</td>
                    <td style="width: 18px">&nbsp;</td>
                    <td style="width: 214px">&nbsp;</td>
                    <td style="width: 52px">&nbsp;</td>
                    <td style="width: 16px">&nbsp;</td>
                    <td style="width: 191px">&nbsp;</td>
                </tr>
                <tr>
                    <td class="text-center" colspan="6">
                        <hr />
                        <asp:Button ID="btnSearch" runat="server" CssClass="btn btn-default btn-lg" OnClick="btnSearch_Click" OnClientClick="return btnSearch_Click();" Text="Search" />
                        <br />
                    </td>
                </tr>
            </table>
            <br />
        </div>


    </div>
</asp:Panel>

    <asp:Panel ID="pnlSecondStep" runat="server">
    <div class="panel panel-default" id="secondStep" style="display:none; width: 800px; margin: 0 auto;" aria-busy="True">
        <div class="panel-heading">
            All guest in room</div>

        <div class="panel-body">
            <div class="alert alert-danger" id="Div1" style="display: none;">
            </div>

            <table class="nav-justified" style="width: 800px">
                <tr>
                    <td>
                        <%--<asp:Button ID="PrintBut" runat="server" CssClass="btn btn-default btn-lg" OnClick="PrintBut_Click" Text="Print Report" />--%>
                        <asp:Button ID="PrintBut" runat="server" CssClass="btn btn-default btn-lg" OnClientClick="doPrint()" Text="Print Report" />
                            &nbsp<asp:Button ID="ExcelBut" runat="server" CssClass="btn btn-default btn-lg" OnClick="ExcelBut_Click" Text="Export to Excel" />
                        &nbsp;<asp:Button ID="PDFBut" runat="server" CssClass="btn btn-default btn-lg" OnClick="PDFBut_Click" Text="Export to PDF" />

                        <br />

                        <asp:GridView ID="gvOccupancy" runat="server" Width="765px" class="table table-bordered" AutoGenerateColumns="False" Caption="Room Guests">
                            <Columns>
                                <asp:BoundField DataField="room_ID" HeaderText="Room Number" />
                                <asp:BoundField DataField="adults_No" HeaderText="Number of Adults" />
                                <asp:BoundField DataField="children_No" HeaderText="Number of Children" />
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td class="text-center" style="height: 22px"><a href="RoomGuest.aspx">&lt; Go back</a></td>
                </tr>
            </table>
        </div>
    </div>
</asp:Panel>
    <script type="text/javascript">
        function transitionToSecondStep() {
            //$('#firstStep').hide('slide', { direction: 'left', easing: 'easeOutQuart', duration: 250 });
            $('#secondStep').delay(250).show('slide', { direction: 'right', easing: 'easeOutQuart', duration: 250 });
        }
    </script>

    <script type="text/javascript">
        function btnSearch_Click() {
            
            var level = $('#cphMain_ddlFloor').val();

            if (level.toString() == "Not Selected") {
                $('#errorBox').html('<strong>Error:</strong> You need to select the <i>room level</i>!');
                $('#errorBox').hide().show();
                return false;
            }


        }


        $('#cphMain_ddlFloor').focus().change(function () {
            $('#errorBox').hide();
        });




    </script>

    <script>
        function doPrint() {
            var prtContent = document.getElementById('<%= gvOccupancy.ClientID %>');
            prtContent.border = 0; //set no border here
            var WinPrint = window.open('', '', 'left=100,top=100,width=1000,height=1000,toolbar=0,scrollbars=1,status=0,resizable=1');
            WinPrint.document.write(prtContent.outerHTML);
            WinPrint.document.close();
            WinPrint.focus();
            WinPrint.print();
            WinPrint.close();
        }
    </script>
</asp:Content>
    